package stancel.peter.smslogger;

import java.io.Serializable;

/**
 * Obsahuje informacie o prijatej sms.
 * @author Peter Stancel
 */
public class Sms implements Serializable{
	
	private static final long serialVersionUID = 7629086396270758632L;
	/** Cas prijatej sms. */
	private String time;
	/** Cislo prijatej sms. */
	private String phoneNumber;
	/** Text prijatej sms. */
	private String text;
	/** Meno kontaktu, ktore je najdene pomocou cisla prijatej sms. */
	private String name = null;
	
	/**
	 * Konstruktor.
	 * @param time Cas prijatej sms.
	 * @param phoneNumber Cislo prijatej sms.
	 * @param text Text prijatej sms.
	 */
	public Sms(String time, String phoneNumber, String text) {
		this.time = time;
		this.phoneNumber = phoneNumber;
		this.text = text;
	}
	
	/**
	 * Konstruktor.
	 * @param time Cas prijatej sms.
	 * @param phoneNumber Cislo prijatej sms.
	 * @param text Text prijatej sms.
	 * @param name Meno kontaktu.
	 */
	public Sms(String time, String phoneNumber, String text, String name) {
		this.time = time;
		this.phoneNumber = phoneNumber;
		this.text = text;
		this.name = name;
	}

	/**
	 * Vrati cas prijatej sms.
	 * @return Cas prijatej sms.
	 */
	public String getTime() {
		return time;
	}

	/**
	 * Vrati cislo prijatej sms.
	 * @return Cislo prijatej sms.
	 */
	public String getPhoneNumber() {
		return phoneNumber;
	}

	/**
	 * Vrati text prijatej sms.
	 * @return Text prijatej sms.
	 */
	public String getText() {
		return text;
	}

	/**
	 * Vrati meno kontaktu, ktory poslal sms.
	 * @return Meno kontaktu, ktory poslal sms. Ak neexistuje - null.
	 */
	public String getName() {
		return name;
	}
}
